#include "relationcardinalitylabel.h"

RelationCardinalityLabel::RelationCardinalityLabel()
{
}

void RelationCardinalityLabel::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    Q_UNUSED(option);
    Q_UNUSED(widget);

    QPainterPath path;
    path.addRoundedRect(this->_boundingRect, 5, 5);

    painter->fillPath(path, this->_palette.relationCardinalityBackground());

    painter->setBrush(this->_palette.text());
    painter->drawText(this->_boundingRect, this->_name, Qt::AlignHCenter | Qt::AlignVCenter);
}
